package com.changgou.goods.feign;

import com.changgou.goods.pojo.Sku;
import entity.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 描述
 *
 * @author ljh
 * @version 1.0
 * @package com.changgou.goods.feign *
 * @Date 2019-11-28
 * @since 1.0
 */

@FeignClient(name = "goods")
public interface SkuFeign {
    @GetMapping("/sku/status/{status}")
    public Result<List<Sku>> findStatus(@PathVariable(name = "status") String status);

    /**
     * 根据SKU的ID 获取SKU的数据
     *
     * @param id
     * @return
     */
    @GetMapping("/sku/{id}")
    public Result<Sku> findById(@PathVariable(name = "id") Long id);

    //更新减少库存
    @GetMapping(value = "/sku/decr/count")
    public Result decrCount(@RequestParam(value = "num") Integer num, @RequestParam(value = "skuId") Long skuId);

}
